package com.syni.mdd.sjb.common.datatreaure.service.impl;

import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.BmsBusinessType;
import com.syni.mdd.sjb.common.component.utils.common.utils.RpcResponseVo;
import com.syni.mdd.sjb.common.component.utils.feign.service.mddAll.BusinessTypeRestService;
import com.syni.mdd.sjb.common.datatreaure.service.BmsBusinessTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 类型表 服务实现类
 * </p>
 *
 * @author lcc
 * @since 2020-05-28
 */
@Service
public class BmsBusinessTypeServiceImpl implements BmsBusinessTypeService {

    @Autowired
    BusinessTypeRestService businessTypeRestService;

    @Override
    public List<BmsBusinessType> getTypeByBusinessId(Integer businessId) {
        List<BmsBusinessType> bmsBusinessTypeList = new ArrayList<>();
        RpcResponseVo rpcResponseVo = businessTypeRestService.getBusinessTypeByBusinessId(businessId);
        if(rpcResponseVo.isSuccess()){
            BmsBusinessType bmsBusinessType = rpcResponseVo.parseObject(BmsBusinessType.class);
            bmsBusinessTypeList.add(bmsBusinessType);
        }
        return bmsBusinessTypeList;
    }
}
